package com.disys.facade;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;

import com.disys.dao.Rec210emplpayinfoDAO;
import com.disys.model.Rec210emplpayinfo;

public class Rec210emplpayinfoFacade {

	private Rec210emplpayinfoDAO obj = new Rec210emplpayinfoDAO();

	public List<Rec210emplpayinfo> findAllRecords() {
		// obj.beginTransaction();
		List<Rec210emplpayinfo> list = null;
		try {
			obj.beginTransaction();
			list = obj.findAll();
			obj.closeTransaction();
		} catch (IllegalStateException ex) {
			list = obj.findAll();
			obj.closeTransaction();
		}
		if (list.size() == 0 || list == null) {
			return new ArrayList<Rec210emplpayinfo>();
		}
		return list;
	}

	public List<Rec210emplpayinfo> getFinalizedRecords(String object,
			Integer isFinalized, BigInteger pId) {
		List<Rec210emplpayinfo> list = obj.findFinalizeRecords(object,
				isFinalized, pId);
		if (list.size() == 0 || list == null) {
			return new ArrayList<Rec210emplpayinfo>();
		}
		return list;
	}

	public Rec210emplpayinfoFacade() {
	
	}

	public List<Integer> getAllProcessIds(String object) {
		obj.beginTransaction();
		List<Integer> list = obj.getAllProcessIds(object);
		obj.closeTransaction();
		return list;
	}
	
	public List<Rec210emplpayinfo> findFinalizeRecords(String object,Integer isFinalized,BigInteger pId){
		//obj.beginTransaction();
		List<Rec210emplpayinfo> list = obj.findFinalizeRecords(object,isFinalized,pId);
		//obj.closeTransaction();
		if(list.size() ==0 || list == null){
			return new ArrayList<Rec210emplpayinfo>();
		}
		return list;
	}
}
